Class account(m)
   balance := m;
   
   withdraw := 
			proc (w) 
                ret := w;
				if w then 
					if balance - w then
						balance := balance - w
					else
						ret := balance;
						balance := 0
					fi
				else
					ret := 0
				fi;
				return := ret
			end;
	deposit := 
			proc (d)
				ret := d;
				if d then 
					balance := balance + d
				else
					ret := 0
				fi;
				return := ret
			end;
	getbalance := 
			proc (q) 
				return := balance
			end
end;

aone := account(50);
atwo := account(100);
baone := aone.getbalance(0);
batwo := atwo.getbalance(0);
wone := aone.withdraw(75);
wtwo := atwo.withdraw(75);
bbone := aone.getbalance(0);
bbtwo := atwo.getbalance(0);
nwone := aone.withdraw(0-100);
nwtwo := atwo.withdraw(0-100);
bcone := aone.getbalance(0);
bctwo := atwo.getbalance(0);
done := aone.deposit(100);
dtwo := atwo.deposit(150);
bdone := aone.getbalance(0);
bdtwo := atwo.getbalance(0);
ndone := aone.deposit(0-100);
ndtwo := atwo.deposit(0-50);
beone := aone.getbalance(0);
betwo := atwo.getbalance(0)
